﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BLL;
using IFactory;

public partial class Week_MonthPlanDetail : System.Web.UI.Page
{
    Authentication dllAuthentication = new Authentication();
    UserPlanMonth dllUserPlanMonth = new UserPlanMonth();
    protected void Page_Load(object sender, EventArgs e)
    {
        dllAuthentication.isLogin();
        if (!IsPostBack)
        {           
            bindMonthPlanGridView();
        }
    }    


    /// <summary>
    /// 
    /// </summary>
    void bindMonthPlanGridView()
    {
        object[] _value = new object[1];
        _value[0] = Utility.HttpHelp.getParamsInt("MonthPlanId");
        this.gvlist.DataSource = dllUserPlanMonth.getUserPlanMonthByMonthPlanId(_value);
        this.gvlist.DataBind();
        for (int i = 0; i < this.gvlist.Rows.Count; i++)
        {
            wrapByComma(this.gvlist, i, 6);
        }
    }

    /// <summary>
    /// 根据逗号换行事件
    /// </summary>
    void wrapByComma(GridView _gridView, int _rowIndex, int _cells)
    {
        string _content = _gridView.Rows[_rowIndex].Cells[_cells].Text;
        _gridView.Rows[_rowIndex].Cells[_cells].Text = _content.Replace("&lt;br&gt;", "<br>");
        //_gridView.Rows[_rowIndex].Cells[_cells].Text = _content.Replace("&gt;", ">");
        _gridView.Rows[_rowIndex].Cells[_cells].Text = _gridView.Rows[_rowIndex].Cells[_cells].Text.Replace(",", "<br>");


    }


}
